package com.hzdp.web.action.account;

import com.hzdp.crypto.codec.MD5;

public class AccountConstants {

	public static String CaptchaSalt = "k3#2sidjfi-3f3D23";
	public static String CaptchaCookieKey = "cakn";
	public static String Token = "tk";
	public static String CaptchaCookieKeySplit = "ek";

	public static String generateToken(String uuid, String captcha) {
		long time = System.currentTimeMillis() + 120 * 1000;
		return generateToken(uuid, captcha, time);
	}

	public static String generateToken(String uuid, String captcha, long time) {
		return MD5.digest(uuid + "_" + captcha + "_" + CaptchaSalt + "_" + time) + CaptchaCookieKeySplit + time;
	}
}
